home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
asmutil
/
asm_n_z.zip
/
RAMADE.ASM
< prev
next >
Wrap
Assembly Source File
|
1987-01-04
|
21KB
|
388 lines
page ,132 ;
title RAMADE - Initialize DOS memory to use segments A,D and E
comment *
┌──────────────────────────────────────────────────────────────────────────────┐
│ Name: ramade │
│ │
│ Function: This program enables the utilization of 192 k of RAM in │
│ addition to the 640 k normal maximum for a PC. The │
│ additional RAM must be installed at segment addresses A000, │
│ D000 and E000. The 64k of RAM in segment A is contiguous │
│ with the normal 640k and is used simply by extending the │
│ memory size above 640. The 128k in segments D and E is not │
│ contiguous with the rest of RAM. It is used for loading │
│ various resident extensions, thus freeing up RAM in the main │
│ area (0-704k). │
│ │
│ Description: The memory size is set to the end of segment E by resetting │
│ the bios memory size and rebooting. Storage in segments A, │
│ D and E is tested and cleared. Miscompares are detected, │
│ but no attempt is made to handle the more common case of │
│ parity checks during the test. │
│ │
│ Resident extensions are loaded in segments D and E by a │
│ secondary command processor which is invoded by RAMADE. │
│ After issuing a SETBLOCK function call to free the 128 K │
│ bytes in segments D and E, RAMADE invokes the secondary │
│ command processor with a command of 'AUTOLOAD'. This should │
│ be a bat file which contains the commands to load the │
│ resident extensions. │
│ │
│ After loading the resident extensions, RAMADE issues other │
│ memory management function calls which leave segments B and │
│ C allocated and free up unused memory below segment B. │
│ │
│ In addition, the warm boot flag in low storage is reset. │
│ The system bios sets this flag when doing a ctl-alt-del │
│ reset, but never clears it, apparently relying on power │
│ dropping to clear the area. (I've recently installed 256k │
│ chips on my system board, and after this installation, │
│ sometimes my system was warm booting when it should have │
│ been cold booting after turning the power off briefly.) │
└──────────────────────────────────────────────────────────────────────────────┘
*
page
comment *
┌──────────────────────────────────────────────────────────────────────────────┐
│ Inputs: Memory size word in low storage │
│ │
│ Outputs: Memory size word in low storage │
│ Reset flag word in low storage │
│ │
│ Return Codes: First entry - none, exit via reboot. │
│ Second entry - always 0. │
│ │
│ Dependancies: Low storage areas - see lowstg segment. │
│ GWASMC macros. │
│ Assumes 832 k installed as described above. │
│ AUTOLOAD bat file invoked. │
│ │
│ Entry Linkage: Standard COM module invocation │
│ │
│ Exit Linkage: Int 21 function 31 (terminate and remain resident) │
│ or reboot via int 19. │
│ │
│ Change History: Ver 0.00 10/26/85 Under development │
│ 1.00 11/03/85 First release │
│ 1.10 11/05/85 Changed address equates to table │
│ 1.20 06/25/86 Save/restore regs around exec cmd │
│ processor for DOS 2.1 bug │
│ 1.21 12/05/86 Zap mem alloc table from "M" to "Z" │
│ This make DOS forget about discontig. │
└──────────────────────────────────────────────────────────────────────────────┘
*
page
;══════════════════════════════════════════════════════════════════════════════
; Get Macros and other standard setups
;──────────────────────────────────────┐
if1 ;
include gwasmc.mac ;
endif ;
.radix 16 ;
;────────────────────────────────────────
;═══════════════════════════════════════════════════════════════════════════════
; Map low storage
;──────────────────────────────────────┐
lowstg segment at 0 ;
org 413 ;
mem_size dw ; Memory size in K, set by bios and us
org 472 ;
rst_flag dw ; Reset flag - set to 1234 by bios to
; indicate warm boot in process.
lowstg ends ;
;────────────────────────────────────────
page
;═══════════════════════════════════════════════════════════════════════════════
; Global data segment entries and equates
;──────────────────────────────────────┐
cgroup group codeseg,dataseg ;
dataseg segment 'data' ;
;
db 'RAMADE 1.21 - IBM Internal Use Only ',0dh,0a
db 'Cornell Wright - WRIGHT at PKEDVM8 ',0dh,0a
;
;
if ($-dataseg) mod 10h ; align to paragraph boundry
org ($-dataseg)+10h-(($-dataseg) mod 10h)
endif ;
;
db 'ADDR TAB' ;
mconend dw 0b000 ; +00 End of contiguous memory (para addr)
mdissta dw 0d000 ; +02 Start of discontiguous memory
mdisend dw 0f000 ; +04 End of discontiguous memory
;
mseg1 dw 0a000 ; +06 First segment to clear and test
mseg1l dw 08000 ; +08 First segment length in words
;
mseg2 dw 0d000 ; +0a Second " "
mseg2l dw 08000 ; +0c " " "
;
mseg3 dw 0e000 ; +0e Third " "
mseg3l dw 08000 ; +10 " " "
;
dataseg ends ;
;──────────────────────────────────────┘
; PS